package com.selfdiscipline.data.model

import java.util.Date
import java.util.UUID

/**
 * Habit entity for the Room database
 */
data class Habit(
    val id: String = UUID.randomUUID().toString(),
    val name: String,
    val description: String? = null,
    val frequency: HabitFrequency,
    val createdAt: Date = Date(),
    val reminderTime: Date? = null,
    val reminderLocationLat: Double? = null,
    val reminderLocationLng: Double? = null,
    val reminderLocationRadius: Int? = null, // in meters
    val currentStreak: Int = 0,
    val longestStreak: Int = 0,
    val lastCompletedDate: Date? = null,
    val active: Boolean = true
)

/**
 * Enum representing frequency options for habits
 */
enum class HabitFrequency {
    DAILY,
    WEEKLY,
    CUSTOM // For more complex patterns
}

/**
 * Represents a single completion of a habit on a specific day
 */
data class HabitCompletion(
    val id: String = UUID.randomUUID().toString(),
    val habitId: String,
    val completedAt: Date = Date(),
    val notes: String? = null
)

/**
 * Represents a habit with its completion records
 */
data class HabitWithCompletions(
    val habit: Habit,
    val completions: List<HabitCompletion>
) 